{% extends 'ProyectoMainBundle:Layout:layout.html.twig' %}

{% block content %}
    {% if resultado is defined %}
        <label>{{ resultado }}</label>
    {% endif %}
    <form action="{{ path(['usuario_update_',perfil]|join , { 'id': entity.id }) }}" method="post" {{ form_enctype(edit_form) }}>
        <input type="hidden" name="_method" value="PUT" />
        <input type="hidden" value="{{ current_page }}" name="current_page" />
        {{ form_row(edit_form.usuario, {'attr' : {'readonly': true} } ) }}
        {{ form_row(edit_form.nomyap) }}
        {{ form_row(edit_form.email) }}
        {{ form_widget(edit_form.password, {'attr': {'value': 'password', 'hidden': true}}) }} 
        {{ form_row(edit_form.telefono) }}
        {{ form_widget(edit_form.perfil,{'attr': {'hidden': true}}) }}
        {{ form_row(edit_form.cvPublico) }}
        {% if perfil == 'admin' %}
          {{ form_row(edit_form.activo) }}
        {% else %}
           {{ form_widget(edit_form.activo, {'attr': {'hidden': true}}) }}
        {% endif %}
        {{ form_row(edit_form._token) }} 
        {{ form_errors(edit_form) }}
        <div>
            <button type="submit">Editar</button>
        </div>
    </form>
{% if not current_page is null %}
    <a href="{{ path('usuario_list',{'current_page': current_page }) }}">Volver</a>
{% endif %}
{% endblock %}
